package com.ztesoft.book.core.quartz.schedulejoblog.dto;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.ztesoft.book.common.constant.CommonParamUtil;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @Description: 定时任务日志实体类（该类不要继承BaseEntity，因为会存在循环调用）
 * @Author: YangFan
 * @Date: 2021-03-19 16:48
 */
@Data
@TableName("schedule_job_log")
public class ScheduleJobLogDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    private String id;

    /**
     * 任务ID
     */
    private String jobId;

    /**
     * SpringBean名称
     */
    private String beanName;

    /**
     * 参数
     */
    private String params;

    /**
     * 任务状态:0 - 成功 1 - 失败
     */
    private Integer status;

    /**
     * 失败信息
     */
    private String error;

    /**
     * 耗时（单位：毫秒）
     */
    private Integer times;

    /**
     * 是否删除  0：正常   1：删除
     */
    private Integer isDeleted;

    /**
     * 创建人
     */
    private String createBy;

    /**
     * 创建时间
     */
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @DateTimeFormat(pattern = CommonParamUtil.NORMAL_FORMAT)
    @JsonFormat(pattern = CommonParamUtil.NORMAL_FORMAT)
    private LocalDateTime createTime;

    /**
     * 更新人
     */
    private String updateBy;

    /**
     * 修改时间
     */
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @DateTimeFormat(pattern = CommonParamUtil.NORMAL_FORMAT)
    @JsonFormat(pattern = CommonParamUtil.NORMAL_FORMAT)
    private LocalDateTime updateTime;


}
